const axios = require('axios');

const BaseURL = 'http://anfriends.heluogangci.com/Service1.asmx';

// 封装请求接口
function getData(xmlUserBody) {
  return axios
    .post(BaseURL, xmlUserBody, {
      headers: {
        'Content-Type': 'text/xml; charset=utf-8',
        'Accept-Encoding': 'identity',
        'User-Agent': 'Dalvik/2.1.0 (Linux; U; Android 9; ONEPLUS A5000 Build/PKQ1.180716.001)',
        Host: 'anfriends.heluogangci.com',
        Connection: 'Keep-Alive'
      }
    })
    .catch(err => {
      console.log('请求出现错误❌', err);
    });
}

exports.getData = getData;
